package com.futures.questionbank.adapter;

import android.content.Context;

import com.classic.adapter.BaseAdapterHelper;
import com.classic.adapter.CommonRecyclerAdapter;
import com.futures.questionbank.R;
import com.futures.questionbank.bean.HangQinBean;

/**
 * author : huang
 * date   : 2020/7/30 0030 9:19
 * version: 1.0
 */
public class HomeJobAdapter extends CommonRecyclerAdapter<HangQinBean> {
    public HomeJobAdapter(Context context) {
        super(context, R.layout.item_list_hot_job);
    }

    @Override
    public void onUpdate(BaseAdapterHelper helper, HangQinBean item, int position) {
        helper.setText(R.id.tv_1,item.getBase());
        helper.setText(R.id.tv_2,item.getCurrency());
        helper.setText(R.id.tv_3,item.getOpen() + "");
        if (item.getDegree() > 0){
            helper.setText(R.id.tv_4,"+" + item.getDegree() + "%");
        }else {
            helper.setText(R.id.tv_4,item.getDegree() + "%");
            helper.setBackgroundRes(R.id.tv_4,R.drawable.bt_background3);
        }
    }
}
